﻿using System.Collections.Generic;
using System.Data;

namespace PGMapper
{
    /// <summary>
    /// Represents a single row returned from a database query.
    /// </summary>
    public class PostgresRow : Dictionary<string, object>
    {
        public PostgresRow(IDataReader reader)
        {
            for (int i = 0; i < reader.FieldCount; i++)
                this[reader.GetName(i)] = reader.IsDBNull(i) ? null : reader.GetValue(i);
        }
    }
}
